[Cin] New thread on bdwrite + mpeg2 HDV video

Terje J. Hanssen terjejhanssen at gmail.com
Mon Nov 7 19:27:35 CET 2022



Den 07.11.2022 18:58, skrev Andrew Randrianasulu:
>
>
> пн, 7 нояб. 2022 г., 20:50 Andrew Randrianasulu <randrianasulu at gmail.com>:
>
>
>
>     пн, 7 нояб. 2022 г., 20:30 Andrew Randrianasulu
>     <randrianasulu at gmail.com>:
>
>
>
>         пн, 7 нояб. 2022 г., 19:40 Andrew Randrianasulu
>         <randrianasulu at gmail.com>:
>
>
>
>             пн, 7 нояб. 2022 г., 19:10 Andrew Randrianasulu
>             <randrianasulu at gmail.com>:
>
>                 Because old thread  now a bit too big for mobile
>                 gmail  client.
>

Yes, I also discovered that and thougt we should continue on another thread
(though Thunderbird/IMAP on my Ultrabook had no problems)


>
>                 Yes, I'll try to see if it fails same way on my end.
>
>                 code seems to check first 100 frames
>
>
>                 2528 static int field_probe(AVFormatContext *fmt_ctx,
>                 AVStream *st)
>                 2529 {
>                 2530  AVDictionary *copts = 0;
>                 2531  //av_dict_copy(&copts, opts, 0);
>                 2532  AVCodecID codec_id = st->codecpar->codec_id;
>                 2533 #if LIBAVCODEC_VERSION_INT <=
>                 AV_VERSION_INT(58,134,100)
>                 2534   AVCodec *decoder = avcodec_find_decoder(codec_id);
>                 2535 #endif
>                 2536 #if LIBAVCODEC_VERSION_INT >=
>                 AV_VERSION_INT(59,16,100)
>                 2537   const AVCodec *decoder =
>                 avcodec_find_decoder(codec_id);
>                 2538 #endif
>                 2539  AVCodecContext *ctx =
>                 avcodec_alloc_context3(decoder);
>                 2540   if( !ctx ) {
>                 2541  fprintf(stderr,"codec alloc failed\n");
>                 2542  return -1;
>                 2543   }
>                 2544  avcodec_parameters_to_context(ctx, st->codecpar);
>                 2545   if( avcodec_open2(ctx, decoder, &copts) < 0 ) {
>                 2546  fprintf(stderr,"codec open failed\n");
>                 2547  return -1;
>                 2548   }
>                 2549  av_dict_free(&copts);
>                 2550
>                 2551   AVFrame *ipic = av_frame_alloc();
>                 2552  AVPacket ipkt;
>                 2553  av_init_packet(&ipkt);
>                 2554   int ilaced = -1;
>                 2555   for( int retrys=100; --retrys>=0 && ilaced<0; ) {
>                 2556  av_packet_unref(&ipkt);
>                 2557     int ret = av_read_frame(fmt_ctx, &ipkt);
>                 2558     if( ret == AVERROR_EOF ) break;
>                 2559     if( ret != 0 ) continue;
>                 2560     if( ipkt.stream_index != st->index ) continue;
>                 2561     if( !ipkt.data || !ipkt.size ) continue;
>                 2562     ret = avcodec_send_packet(ctx, &ipkt);
>                 2563     if( ret < 0 ) {
>                 2564  fprintf(stderr, "avcodec_send_packet failed\n");
>                 2565  break;
>                 2566     }
>                 2567     ret = avcodec_receive_frame(ctx, ipic);
>                 2568     if( ret >= 0 ) {
>                 2569  ilaced = ipic->interlaced_frame ? 1 : 0;
>                 2570  break;
>                 2571     }
>                 2572     if( ret != AVERROR(EAGAIN) )
>                 2573  fprintf(stderr, "avcodec_receive_frame failed
>                 %d\n", ret);
>                 2574   }
>                 2575  av_packet_unref(&ipkt);
>                 2576  av_frame_free(&ipic);
>                 2577  avcodec_free_context(&ctx);
>                 2578   return ilaced;
>
>                 may be we can add flags to force interlaced vs
>                 progressive to bdwrite ... and/or debug why it fails.
>
>
>             sorry, not m2t or m2ts files were found on my main
>             harddrive, so blind shot!
>
>             Terje, can you recompile bdwrite with attached patch and
>             see if it improves situation?
>

I hope to avoid recompiling my ultrabook, where I just have installed 
the CinGG appimage


>
>
>         err, I think second patch also needed, because ilace in
>         bdwrite is just 1/0/-1 not more detailed.
>
>
>
>
>     finally found m2t file, for me bdwrite does not complain but
>     resulting file is unplayable
>

Note:
I just used the short m2t file you linked to; maybe it is to short for 
interlace probe?

    this one contain real very short hdv sample with mp2 sound
    http://twenkid.com/os/3.m2t


>
>
>     note I used -b switch for new mkudffs so it works with 2048 blocks
>     and not default 512
>

I used the plain manual step 3 without -b, as also used for 2048 blocks 
in the sample step 2 ?
I 'll do a new attempt with -b and reort the result


>
>     root at slax:/tmp# mkudffs -b 2048 /tmp/newfilename.udfs 25915
>      filename=/tmp/newfilename.udfs             label=LinuxUDF        
>                           uuid=6369651cdf849fbf blocksize=2048        
>               blocks=25915                                    
>     udfrev=2.01
>     start=0, blocks=16, type=ERASE                              
>     start=16, blocks=4, type=VRS start=20, blocks=76, type=ERASE      
>             start=96, blocks=16, type=MVDS                          
>     start=112, blocks=16, type=ERASE                             
>     start=128, blocks=4, type=LVID start=132, blocks=124, type=ERASE  
>     start=256, blocks=1, type=ANCHOR
>     start=257, blocks=25400, type=PSPACE   start=25657, blocks=1,
>     type=ERASE
>     start=25658, blocks=1, type=ANCHOR                        
>     start=25659, blocks=69, type=ERASE                             
>      start=25728, blocks=16, type=RVDS  start=25744, blocks=170,
>     type=ERASE           start=25914, blocks=1, type=ANCHOR
>     root at slax:/tmp# mount -o loop /tmp/newfilename.udfs /mnt/test
>
>     root at slax:/tmp# bdwrite /mnt/test /home/guest/20081103140154.m2t
>
>     root at slax:/tmp# umount /mnt/test
>
>
>
>     playing result in many
>
>     root at slax:/tmp# mplayer -vo null br://tmp/newfilename.udfs
>       MPlayer UNKNOWN-11.2.0 (C) 2000-2022 MPlayer Team
>      do_connect: could not connect to socket                       
>      connect: No such file or directory
>      Failed to open LIRC support. You will not be able to use your
>     remote control.                Playing br://tmp/newfilename.udfs.
>                                    The hostname option must be an
>     integer: tmp              Struct bluray, field hostname parsing
>     error: tmp  libavformat version 59.33.100 (internal)            
>      bluray.c:707: Skipping broken unit at 0                          
>       bluray.c:255: 00000.m2ts: no timestamp for SPN 0 (got 0). clip
>     46909800-47511000.    bluray.c:707: Skipping broken unit at 0    
>                   bluray.c:707: Skipping broken unit at 6144         
>                   bluray.c:255: 00000.m2ts: no timestamp for SPN 0
>     (got 0). clip 46909800-47511000.    bluray.c:707: Skipping broken
>     unit at 0                    bluray.c:707: Skipping broken unit at
>     6144                     bluray.c:707: Skipping broken unit at
>     12288                    bluray.c:707: Skipping broken unit at
>     18432 bluray.c:707: Skipping broken unit at 24576
>
>     {and so on}
>
>
>
> on the other hand reencoding audio like this
>
> root at slax:/tmp# ffmpeg -i /home/guest/20081103140154.m2t -c:v copy 
> -c:a ac3 -b:a 384k 2008.m2ts
>
> and repeating steps with mkudffs / mount /bdwrite /umount resulted in 
> working in mplayer file!
>
> I have 'old' 4.4 ffmpeg, so no bluray encoding for me.
>
> also, I used wcalc as console calc
>
>
>
>
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cinelerra-gg.org/pipermail/cin/attachments/20221107/cb024e70/attachment-0001.htm>


More information about the Cin mailing list