Hidden audio in H264 - wrapped_avframe
I am struggling with the camera output of a HQCAM camera from AliExpress, when the video is written to the SD card. The output video files on the SD card contain video (H264) and audio (G726). With the Windows based CONVERTER.EXE provided by HQCAM, I can convert them to AVI with video and audio present. The problem is: the CONVERTER.EXE is a UI based tool, where I have to select each single file, but I have to automate it. I would like to use ffmpeg for this. When I use ffmpeg -hide_banner -i file.h264 -t 0 -f null - I get: Input #0, h264, from 'file.264': Duration: N/A, bitrate: N/A Stream #0:0: Video: h264 (High), yuvj420p(pc, bt709, progressive), 1920x1080, 25 fps, 1200k tbr, 1200k tbn Stream mapping: Stream #0:0 -> #0:0 (h264 (native) -> wrapped_avframe (native)) Press [q] to stop, [?] for help Output #0, null, to 'pipe:': Metadata: encoder : Lavf61.9.108 Stream #0:0: Video: wrapped_avframe, yuvj420p(pc, bt709, progressive), 1920x1080, q=2-31, 200 kb/s, 25 fps, 25 tbn Metadata: encoder : Lavc61.33.102 wrapped_avframe [h264 @ 00000260240298c0] Invalid NAL unit 0, skipping. [h264 @ 00000260240298c0] no frame! [out#0/null @ 000002602402df00] video:0KiB audio:0KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: unknown [out#0/null @ 000002602402df00] Output file is empty, nothing was encoded(check -ss / -t / -frames parameters if used) frame= 0 fps=0.0 q=0.0 Lsize=N/A time=N/A bitrate=N/A speed=N/A For me this output is difficult read. Using the ffmpeg command, that works using the RTSP port of the camera: ffmpeg -i file.h264 -hide_banner -loglevel warning -err_detect ignore_err -dn -sn -map 0:0 -codec:v copy -map 0:1 -filter:a aresample=osr=8000:ochl=mono -codec:a aac -b:a 64k -shortest file.mp4 it doesn't work. It leads to Stream map '' matches no streams. To ignore this, add a trailing '?' to the map. Failed to set value '0:1' for option 'map': Invalid argument Unfortunately, I found no information what "wrapped_avframe" means and how I can convert such content to MP4/H264/AAC with ffmpeg. Can anybody help on this?
Hello, And IMO should not work. .h264 is video only stream in general. Does not contain audio so searching or encoding audio will not succeed. BUT: I do not work with wrapped_avframe, but you may try: ffmpeg -i file.h264 -hide_banner -loglevel warning -err_detect ignore_err -dn -sn -map 0:v -map 0:a -f fifo -pix_fmt yuv420p -c:v libx264 -preset veryfast -profile:v high -level 41 -crf 16 -tune film -c:a aac -b:a 160k -ac 2 -ar 48000 -shortest -y -f mp4 output.mp4 Why? you cannot STORE raw h264 video (without reencode) in mp4 container - so you should reencode first (just like audio). Hope it helps. W dniu 2025-04-14 o 13:57, Hans Schuell (GiraOne) pisze: [cut]
ffmpeg -i file.h264 -hide_banner -loglevel warning -err_detect ignore_err -dn -sn -map 0:0 -codec:v copy -map 0:1 -filter:a aresample=osr=8000:ochl=mono -codec:a aac -b:a 64k -shortest file.mp4
it doesn't work. It leads to
-- Pozdrawiam, bloodman@gmail.com
Thanks for the suggestion, but the command leads to the same error, I already had: Stream map '' matches no streams. To ignore this, add a trailing '?' to the map. Failed to set value '0:a' for option 'map': Invalid argument Regarding "you cannot STORE raw h264 video (without reencode) in mp4 container": If I omit the audio, then I can use "-map 0:0 -codec:v copy" and the result is a useable MP4 (without audio). But the audio must be somewhere in the file, otherwise the HQCAM converter tool wouldn't be able to access it. -----Ursprüngliche Nachricht----- Von: ffmpeg-user <ffmpeg-user-bounces@ffmpeg.org> Im Auftrag von BloodMan Gesendet: Montag, 14. April 2025 14:49 An: ffmpeg-user@ffmpeg.org Betreff: Re: [FFmpeg-user] Hidden audio in H264 - wrapped_avframe Hello, And IMO should not work. .h264 is video only stream in general. Does not contain audio so searching or encoding audio will not succeed. BUT: I do not work with wrapped_avframe, but you may try: ffmpeg -i file.h264 -hide_banner -loglevel warning -err_detect ignore_err -dn -sn -map 0:v -map 0:a -f fifo -pix_fmt yuv420p -c:v libx264 -preset veryfast -profile:v high -level 41 -crf 16 -tune film -c:a aac -b:a 160k -ac 2 -ar 48000 -shortest -y -f mp4 output.mp4 Why? you cannot STORE raw h264 video (without reencode) in mp4 container - so you should reencode first (just like audio). Hope it helps. W dniu 2025-04-14 o 13:57, Hans Schuell (GiraOne) pisze: [cut]
ffmpeg -i file.h264 -hide_banner -loglevel warning -err_detect ignore_err -dn -sn -map 0:0 -codec:v copy -map 0:1 -filter:a aresample=osr=8000:ochl=mono -codec:a aac -b:a 64k -shortest file.mp4
it doesn't work. It leads to
-- Pozdrawiam, bloodman@gmail.com _______________________________________________ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-request@ffmpeg.org with subject "unsubscribe".
Hello, Try to omit -dn -sn or omit -dn -sn and all -map, something like: ffmpeg -i file.h264 -hide_banner -loglevel warning -err_detect ignore_err -pix_fmt yuv420p -c:v libx264 -preset veryfast -profile:v high -level 41 -crf 16 -tune film -c:a aac -b:a 160k -ac 2 -ar 48000 -shortest -y -f mp4 output.mp4 btw. maybe you can attach a link to short 30sec sample, then I could try... greets, W dniu 2025-04-14 o 20:36, Hans Schuell (GiraOne) pisze:
Thanks for the suggestion, but the command leads to the same error, I already had:
Stream map '' matches no streams. To ignore this, add a trailing '?' to the map. Failed to set value '0:a' for option 'map': Invalid argument
Regarding "you cannot STORE raw h264 video (without reencode) in mp4 container": If I omit the audio, then I can use "-map 0:0 -codec:v copy" and the result is a useable MP4 (without audio). But the audio must be somewhere in the file, otherwise the HQCAM converter tool wouldn't be able to access it.
-----Ursprüngliche Nachricht----- Von: ffmpeg-user <ffmpeg-user-bounces@ffmpeg.org> Im Auftrag von BloodMan Gesendet: Montag, 14. April 2025 14:49 An: ffmpeg-user@ffmpeg.org Betreff: Re: [FFmpeg-user] Hidden audio in H264 - wrapped_avframe
Hello,
And IMO should not work.
.h264 is video only stream in general. Does not contain audio so searching or encoding audio will not succeed. BUT:
I do not work with wrapped_avframe, but you may try:
ffmpeg -i file.h264 -hide_banner -loglevel warning -err_detect ignore_err -dn -sn -map 0:v -map 0:a -f fifo -pix_fmt yuv420p -c:v libx264 -preset veryfast -profile:v high -level 41 -crf 16 -tune film -c:a aac -b:a 160k -ac 2 -ar 48000 -shortest -y -f mp4 output.mp4
Why? you cannot STORE raw h264 video (without reencode) in mp4 container - so you should reencode first (just like audio).
Hope it helps.
W dniu 2025-04-14 o 13:57, Hans Schuell (GiraOne) pisze: [cut]
ffmpeg -i file.h264 -hide_banner -loglevel warning -err_detect ignore_err -dn -sn -map 0:0 -codec:v copy -map 0:1 -filter:a aresample=osr=8000:ochl=mono -codec:a aac -b:a 64k -shortest file.mp4
it doesn't work. It leads to
-- Pozdrawiam, bloodman@gmail.com
participants (2)
-
BloodMan -
Hans Schuell (GiraOne)